# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=igmpproxy
pkgver=0.3
pkgrel=0
pkgdesc="A simple dynamic Multicast Routing Daemon using only IGMP signalling"
url="https://sourceforge.net/projects/igmpproxy/"
arch="all"
license="GPL-2.0-or-later"
makedepends="linux-headers"
subpackages="$pkgname-doc"
source="https://github.com/pali/igmpproxy/releases/download/$pkgver/igmpproxy-$pkgver.tar.gz"

build() {
	# our kernel have a patch that changes MAXVIFS
	# note that this is ABI incompatible
	sed -i -e 's:^#define MAX_MC_VIFS.*:#define MAX_MC_VIFS   MAXVIFS:' \
		src/igmpproxy.h

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="0b1deca544317e2f0b1ff550e5921e8d6f64565f7cd72b6210fc7d3d7c3a301875088687a31ca5a29d310b2931695bd7a77e41dc5685ab7175ea1d41fe9246af  igmpproxy-0.3.tar.gz"
